from django.db import models

from apps.goods.models import SKU
from apps.users.models import User,Address

class OrderGoods(models.Model):
    """订单商品"""
    user_name = models.CharField(max_length=50, verbose_name='姓名', blank=True)
    order_num = models.CharField(max_length=50, verbose_name="订单", blank=True)
    sku = models.CharField(max_length=50, verbose_name="订单商品", blank=True)
    price = models.DecimalField(max_digits=10, decimal_places=2, verbose_name="总价")

    class Meta:
        db_table = "tb_order_goods"
        verbose_name = '订单'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.sku.name